<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="业务单产值分配规则" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<script language="javascript">
	function doSave(){
		var total=0;
		var busi=document.getElementById("busi").value;
		var foll=document.getElementById("foll").value;
		var rece=document.getElementById("rece").value;
		var make=document.getElementById("make").value;
		var setu=document.getElementById("setu").value;
		var comDesi=document.getElementById("com_desi").value;
		if(!isNaN(busi)){
			total=addMul(total,busi);
		}
		if(!isNaN(foll)){
			total=addMul(total,foll);
		}
		if(!isNaN(rece)){
			total=addMul(total,rece);
		}
		if(!isNaN(make)){
			total=addMul(total,make);
		}
		if(!isNaN(setu)){
			total=addMul(total,setu);
		}
		if(!isNaN(comDesi)){
			total=addMul(total,comDesi);
		}
		var canSave=false;
		if(total<1){
			if(confirm("占比合计小于1，是否继续保存？")){
				canSave=true;
			}
		}else{
			canSave=true;
		}
		if(canSave){
			document.getElementById("buttonDiv").style.display="none";
			document.getElementById("waitDiv").style.display="";
			frm.submit();
		}
	}
	function doCancel(){
		if(window.opener){
			window.close();
		}else{
			parent.ClosePop();
		}
	}
	function showMe(){
	}
</script>
</head>
<body oncontextmenu="return false" scroll="no" onLoad="showMe();" class="sheet modal-dialog" style="padding-top:15px;text-align:center;">
<div class="sheet-main" id="bodyDiv" style="width:470px;text-align:left;margin:auto;">
	<div class="sheet-top">
	    <div class="content" >
	      <h2><c:if test="${billId!=null && billId!=''}">${billCode}</c:if><c:if test="${billId==null || billId==''}">业务单</c:if>产值分配规则</h2>
	      <p>设置业务单产值在各个环节如何分配，1表示100%，0.5表示50%，以此类推</p>
	    </div>
    </div>
	<form name="frm" method="post" action="SetOvPercent.ihtm">
	  <div class="sheet-list" style="width:100%;background:#fff url(../images/business-soo-bg.gif) repeat-x;">
			<%@ include file="../inc/AlertMsg.jsp"%> 
			<table border="0" cellspacing="1" cellpadding="1" align="center" class="table-0">
				<tr>
			      	<th style="width:25%">接单产值占比：</th>
			      	<td style="width:25%">
			      		<input type="text" class="TextBox" maxlength="6" style="width:44px" id="busi" name="busi" value="${busi}">
			      	</td>
			      	<th style="width:25%">跟单产值占比：</th>
			      	<td style="width:25%">
			      		<input type="text" class="TextBox" maxlength="6" style="width:44px" id="foll" name="foll" value="${foll}">						
			     	</td>
				</tr>
				<tr>
			      	<th>收欠费产值占比：</th>
			      	<td>
			      		<input type="text" class="TextBox" maxlength="6" style="width:44px" id="rece" name="rece" value="${rece}">
			      	</td>
			      	<th>制作产值占比：</th>
			      	<td>
			      		<input type="text" class="TextBox" maxlength="6" style="width:44px" id="make" name="make" value="${make}">						
			     	</td>
				</tr>
				<tr>
			      	<th>设计产值占比：</th>
			      	<td colspan="3">
			      		<input type="text" class="TextBox" maxlength="6" style="width:44px" id="com_desi" name="com_desi" value="${comDesi}">(公司设计)
			      		<input type="text" class="TextBox" maxlength="6" style="width:44px" id="cli_desi" name="cli_desi" value="${cliDesi}">(客户来稿)
			      	</td>
				</tr>
				<tr>
			      	<th colspan="4"><hr width="90%"></th>
				</tr>
				<tr>
			      	<th>安装产值占比：</th>
			      	<td colspan="3">
			      		<input type="text" class="TextBox" maxlength="6" style="width:44px" id="setu" name="setu" value="${setu}">(占安装单金额的比例)
			      	</td>
				</tr>
			</table>
	  </div>
		<div class="modal-buttom" id="buttonDiv">
			<input type="button" class="buttom-a" value="保 存" onClick="doSave();">
			<input type="button" class="buttom-a" value="取 消" onClick="doCancel();">
			<input type="hidden" name="bill_id" id="bill_id" value="${billId}">
		</div>
		<div class="modal-buttom" id="waitDiv" style="display:none">
			<span style="color:#ffffff">请稍候...</span>
		</div>
	</form>
</div>		
</body>
</html>